var t = require("../common/index.js");

require("../../../utils/image.js");
var app = getApp()
Component({
    properties: {
        data: { type: Object },
        floorIndex: { type: Number }
    },
    data:{imgurl:app.getImgUrl()},
    methods: {
        goLink: function(e) {
          console.log('actionList goLink', e)
            var o = e.currentTarget.dataset, i = o.type, a = o.positionIndex, n = o.timestamp, 
            r = e.currentTarget.offsetTop;
            var s = this.data.floorIndex;
            if ("goods" === i) {
                var item = e.currentTarget.dataset.item;
                t.goLink({
                    type: "goods",
                    data: { item : item },
                    saOption: {
                        componentName: "actionList",
                        floorIndex: s,
                        positionIndex: a,
                        timestamp: n,
                        offsetTop: r
                    }
                });
            } else if ("page" === i) {
                var c = e.currentTarget.dataset.link;
                t.goLink({
                    type: "page",
                    data: { item: item },
                    saOption: {
                        componentName: "actionList",
                        floorIndex: s,
                        positionIndex: a,
                        timestamp: n,
                        offsetTop: r
                    }
                });
            }
        },
        goMore(e){
          console.log('goMore e',e)
          var url = e.currentTarget.dataset.url;
          if(url!=''){
            wx.navigateTo({
              url: url
            })
          }
        }
    },
});